﻿  <!--
  Please keep these information:
  From: http://wpfhelpertools.codeplex.com/ 
  Author: http://www.cnblogs.com/xiaokang088 
  Email: xiaokang060@hotmail.com
  -->
<Window x:Class="CodeGenerate.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Code Generate For DependencyProperty" Height="350" Width="525" SizeToContent="Height">
  <Grid>
    <StackPanel  Margin="10" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
      <StackPanel.Resources>
        <Style TargetType="Grid"  >
          <Style.Setters >
            <Setter Property="Margin" Value="0,10,0,0" />
            <Setter Property="VerticalAlignment" Value="Stretch" />
          </Style.Setters>
        </Style>

        <Style TargetType="TextBlock"  >
          <Style.Setters >
            <Setter Property="Grid.Column" Value="0" />
            <Setter Property="HorizontalAlignment" Value="Right" />
            <Setter Property="Margin" Value="10,0,3,0" />
            <Setter Property="VerticalAlignment" Value="Stretch" />
          </Style.Setters>
        </Style>

        <Style TargetType="ComboBox"  >
          <Style.Setters >
            <Setter Property="Grid.Column" Value="1" />
            <Setter Property="HorizontalAlignment" Value="Stretch" />
            <Setter Property="Margin" Value="10,0,10,0" />
            <Setter Property="VerticalAlignment" Value="Stretch" />
          </Style.Setters>
        </Style>
  
        <Style TargetType="TextBox"  >
          <Style.Setters >
            <Setter Property="Grid.Column" Value="1" />
            <Setter Property="HorizontalAlignment" Value="Stretch" />
            <Setter Property="Margin" Value="10,0,10,0" />
            <Setter Property="VerticalAlignment" Value="Bottom" />
            <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
            <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
          </Style.Setters>
        </Style>

      </StackPanel.Resources>

      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition  Width="100"/>
          <ColumnDefinition  Width="200*"/>
        </Grid.ColumnDefinitions>
        <TextBlock  Text="PropertyName:" />
        <TextBox Name="tbPropertyName" Text="Test" />
      </Grid>

      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition  Width="100"/>
          <ColumnDefinition  Width="200*"/>
        </Grid.ColumnDefinitions>
        <TextBlock  Text="OwnerName:" />
        <TextBox Name="tbOwnerName" Text="TestWindow" />
      </Grid>

      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition  Width="100"/>
          <ColumnDefinition  Width="200*"/>
        </Grid.ColumnDefinitions>
        <TextBlock  Text="Type:" />
        <ComboBox IsEditable="True" Name="cbType" Text="Double" >
          <ComboBoxItem Content="Int" />
          <ComboBoxItem Content="String" />
          <ComboBoxItem Content="Double" />
        </ComboBox>
      </Grid>

      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition  Width="100"/>
          <ColumnDefinition  Width="200*"/>
        </Grid.ColumnDefinitions>
        <TextBlock  Text="Request:" />
        <TextBox Name="tbRequest"    Height="100"   />
      </Grid>

      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition  Width="100"/>
          <ColumnDefinition  Width="200*"/>
        </Grid.ColumnDefinitions>
        <TextBlock  Text="Result:" />
        <TextBox Name="tbResult"  Height="200" TextWrapping="Wrap"  AcceptsReturn="True"/>
      </Grid>

      <StackPanel Orientation="Horizontal">
        <Button Content="Add" Height="42" HorizontalAlignment="Center" Margin="10,10,10,0" Name="btnAdd" VerticalAlignment="Top" Width="169" Click="btnAdd_Click" />
        <Button Content="Output" Height="42" HorizontalAlignment="Center" Margin="10,10,10,0" Name="btnWrite" VerticalAlignment="Top" Width="169" Click="btnWrite_Click" />
      </StackPanel>

    </StackPanel>

  </Grid>
</Window>
